package io.polly.common.constant;

import lombok.Getter;

/**
 * @author ldz
 * @version V1.0
 * @title: NotifyTypeEnum
 * @description: 动态线程池通知数据类型，用于扩展ThreadPoolExecutor处理
 * @date: 2022/3/21 11:38
 */
@Getter
public enum NotifyTypeEnum {


    CHANGE("change"),

    ACTIVES("actives"),

    CAPACITY("capacity"),

    REJECT("reject"),;

    private final String value;

    NotifyTypeEnum(String value) {
        this.value = value;
    }

    public static NotifyTypeEnum of(String value) {
        for (NotifyTypeEnum notifyTypeEnum : NotifyTypeEnum.values()) {
            if (notifyTypeEnum.value.equals(value)) {
                return notifyTypeEnum;
            }
        }
        return null;
    }
}
